/**
 * typeof 判断是不是Object
 * typeof 判断为 object 的有 数组[]、null、对象{}
 */

function isObject(obj) {
  if (typeof obj === 'object') {
    return true;
  }
  return false;
}

console.log('number typeof is object? ====> ' + isObject(1)); // false
console.log('string typeof is object? ====> ' + isObject('hello')); // false
console.log('boolean typeof is object? ====> ' + isObject(true)); // false
console.log('undefined typeof is object? ====> ' + isObject(undefined)); // false
console.log('null typeof is object? ====> ' + isObject(null)); // true
console.log('function typeof is object? ====> ' + isObject(function a() {})); // false
console.log('array typeof is object? ====> ' + isObject([1, 2, 3])); // true
console.log('{} typeof is object? ====> ' + isObject({ a: 1 })); // true
console.log('symbol typeof is object? ====> ' + isObject(Symbol(1))); // false
console.log('bigInt typeof is object? ====> ' + isObject(56n)); // false
